<?php $this->beginContent('/layouts/main'); ?>

<?php
$this->pageTitle = Yii::app()->name;
?>

<div id="header" class="inner">
    <div class="list-slider"></div>
    <div class="page-title">
        <h2>Blog</h2>
        <p>Proin tempor porttitor eros vitae viverra.</p>
    </div>
    <?php echo CHtml::image(Yii::app()->theme->baseUrl . "/images/content/img-title-blog.jpg", "") ?>
<!--			<img src="images/content/img-title-blog.jpg" alt=""  />-->
</div><!-- end #header -->
<div class="line"></div><!-- end .line -->

<div id="content">

    <div id="main">

        <!--                                        <div id="breadcrumb">
                                                    You are here: Home / <a href="#">Blog</a>
                                                </div>-->
        <div id="maincontent">
            <?php echo $content; ?>

            <div class="clear"></div><!-- clear float -->
        </div><!-- end #maincontent -->




        <div id="side">
            <ul>
                <li class="widget-container">
                    <h2 class="widget-title">Chuyên mục</h2>

                    <!--GET DYNAMIC TOPICS FROM DATABASE TO SIDEBAR-->
                    <?php
                    $sql = "SELECT * FROM tbl_topic";
                    $command = Yii::app()->db->createCommand($sql);
                    $datareceived = $command->query(); //use query to return result

                    foreach ($datareceived as $row) {
                        $topiclisting[] = array(
                            'label' => $row['name'],
                            'url' => array('/site/blog/id/' . $row['id']),
                        );
                    }

                    $this->widget('zii.widgets.CMenu', array(
                        'items' => $topiclisting,
                    ))
                    ?>
                </li>

                <li class="widget-container">
                    <h2 class="widget-title">Archives</h2>
                    <ul>
                        <li><a href="#">December 2010</a></li>
                        <li class="current"><a href="#">January 2011</a></li>
                        <li><a href="#">February 2011</a></li>
                        <li><a href="#">March 2011</a></li>
                        <li><a href="#">April 2011</a></li>
                    </ul>
                </li>

                <li class="widget-container widget-search">
                    <h2 class="widget-title">Search</h2>
                    <form method="post" action="">
                        <div><input type="text"  class="inputbox" value="" /></div>
                    </form>
                </li>
            </ul>
        </div>

        <div class="clear"></div><!-- clear float -->
    </div><!-- end #main -->
</div><!-- end #content -->


<?php $this->endContent(); ?>
